<!DOCTYPE html>
<head>
    <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0" />
    <meta name="apple-mobile-web-app-capable" content="yes" />
    <meta name="format-detection" content="telephone=no" />
    <link rel="stylesheet" href="{{asset('/images/didi/css.css?'.time())
   }}">
    <title>{{$flagInfo->name}}的新学期Flag</title>
    <script>

        var flagId  = "{{$flagInfo->id}}";
        var openId  = "{{$openId}}";
        var host    = "http://{{$host}}";

        window.onload = function () {

            wxshareinit();


            $(window).on('touchmove',function(){
                if($(window).scrollTop() >= 20)
                {   
                    $('.more').remove();    
                    $(window).off('touchmove');
                }
            })

            
        }

        function wxshareinit(){



            //var title   = "{{$flagInfo->name}}的新学期Flag";
            var title   = "滴滴Flag实验室";
            var link    = host + "/www/didi/commentFlag?id={{$flagInfo->id}}";
            var imgUrl  = host + "/images/didi/wxshare.png";
            var desc    = "{{$shareData}}";
            var groupTitle = desc;

            //var musicdata   =  "http://test.wx.laohoulundao.com/video/testmp3.mp3";
            wx.config(<?php echo $weixinJs->config($apiList, false) ?>);
            wx.ready(function()
            {
                wx.onMenuShareTimeline({
                    title: groupTitle, // 分享标题
                    link: link, // 分享链接，该链接域名或路径必须与当前页面对应的公众号JS安全域名一致
                    imgUrl: imgUrl // 分享图标
                });


                //获取“分享给朋友”按钮点击状态及自定义分享内容接口
                wx.onMenuShareAppMessage({
                    title: title, // 分享标题
                    desc: desc, // 分享描述
                    link: link, // 分享链接，该链接域名或路径必须与当前页面对应的公众号JS安全域名一致
                    imgUrl: imgUrl // 分享图标
                });

//                wx.showMenuItems({
//                    menuList: ['onMenuShareTimeline','onMenuShareAppMessage'] // 要显示的菜单项，所有menu项见附录3
//                });
            });
        }


    </script>
    <script src="{{asset('/js_system/jquery.min.js')}}"></script>
    <script src="{{asset('/images/didi/js.js')}}"></script>
    <script src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js" type="text/javascript" charset="utf-8"></script>

</head>
<body>



<div>
    <div class="commenttop">
        <!-- <img src="{{asset("/images/didi/zanwei.png")}}" style="width:100%;display: block;"> -->
        <img src="{{asset("/images/didi/shareimg/".$flagInfo->id.".jpg")}}">
    </div>
    
    <p class="zan" style="margin-bottom:20px;">
        <span>
            @if($flagInfo->zan_id > 0)
                <img src="{{asset('images/didi/zan-yes.png')}}">
            @else
                <img src="{{asset('images/didi/zan.png')}}" id="zan-flag-img-{{$flagInfo->id}}" onclick="didi2.zan({{$flagInfo->id}},'flag')">
            @endif
        </span>
        <span id="zan-flag-{{$flagInfo->id}}"  zan="1">{{$flagInfo->zan_number}}</span>
    </p>
</div>



<div class="middle">
    <img src="{{asset("/images/didi/pl.png")}}">
    <div class="alink">
        <a onclick="return false;"></a>
        <a href="{{$h5Url}}"></a>
        <a onclick="return false;"></a>
    </div>
</div>


<ul class="flags">
    @foreach($comments as $key => $com)
        <li>
            <p class="content">
                <span> {{$com->content}}</span>
            </p>

            <p class="content">
                <label class="zan-span">
                    @if($com->zan_id > 0)
                        <img src="{{asset('images/didi/zan-yes.png')}}" >
                    @else
                        <img src="{{asset('images/didi/zan-no.png')}}" id="zan-comment-img-{{$com->comment_id}}" onclick="didi2.zan({{$com->comment_id}},'comment')">
                    @endif
                    <span id="zan-comment-{{$com->comment_id}}" class="zan-num"  zan="1">{{$com->zan_number}}</span>    
                </label>
                
            </p>


            <!-- <p class="zan">
                <span>
                    @if($com->zan_id > 0)
                        <img src="{{asset('images/didi/zan-yes.png')}}">
                    @else
                        <img src="{{asset('images/didi/zan-no.png')}}" id="zan-comment-img-{{$com->comment_id}}" onclick="didi2.zan({{$com->comment_id}},'comment')">
                    @endif
                </span>
                <span id="zan-comment-{{$com->comment_id}}"  zan="1">{{$com->zan_number}}</span>
            </p>
             -->
             


        </li>
    @endforeach

</ul>

<div class="empty"></div>

<div class="comment-input nofocurs">
    {{--<img src="{{asset('images/didi/say.png')}}">--}}

    <input placeholder="匿名评论" id="comment"/>
    <span onclick="didi2.addComment()">发送</span>
</div>


   <p class="more tiaodong" ng-if="showbtn"><img src="{{asset('images/didi/more.png')}}"></p>

<div class="myalert">
    <div class="alert-box">
        <p class="title" id="alertTitle">您的评论成功</p>
        <p class="btn" onclick="didi2.closeAlert();">确定</p>
    </div>
</div>


</body>
</html>

